<?php
include("../Controller/redirection.php");
?>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../assets/ico/favicon.ico">
    <link href="Index.css" rel="stylesheet" type="text/css">

    <title>ExiaStore</title>

    <!-- Bootstrap core CSS -->
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="offcanvas.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
  </head>
  
  

  <body style="background-color:rgb(180,180,180)">
      
      
      <style type="text/css">
      #formulaire
      { 
      text-align: center;
      padding-top: 100px;
      }
      </style>
          
      <style type="text/css">
      #Message
      {
      color: white;
      }    
      </style>
      
    <?php
    if(empty($_SESSION['login']))
    include ("navbarVisiteur.php");  
    else
    include ("navbar.php"); 
    ?>
      
         

     
<?php

        try
	{
	$bdd = new PDO('mysql:host=localhost;dbname=exiastore', 'root', ''); // Création de l'objet bdd
	}
	catch (Exception $e)
	{
        die('Erreur : ' . $e->getMessage()); // On affiche pas d'erreur si il devait y en avoir
	}
        
      
         
        $login = $_SESSION['login'];
        
	
	$req = $bdd->prepare('SELECT * FROM membre, adresse WHERE login = :login');
        $req->execute(array('login' => $login));
        
        $donnees = $req->fetch();
	

        
?>
      
     <div class="container" id='formulaire'>
		
     
	  
         <h2 class="form-signin-heading">Vos informations personnelles</h2></br>
			
        <form  role="form" method="post" action="../Controller/modifierMembre.php">
            
                <?php echo "<strong>Votre pseudo actuel : </strong>" , $donnees['login'] ,"</br></br>" ?>
            
                <?php echo "<strong>Votre nom actuel : </strong>" , $donnees['nom'] ,"</br>" ?>
		<label>Nouveau nom:</label>
                <input type="text" size="20" name="nom" value="<?php echo $donnees['nom']?>" maxlength="50" required autofocus></br></br></br>
 
                
                <?php echo "<strong>Votre prénom actuel : </strong>" , $donnees['prenom'] ,"</br>" ?>
		<label>Nouveau prenom:</label>
		<input type="text" size="20" name="prenom" value="<?php echo $donnees['prenom']?>" maxlength="50" required autofocus></br></br></br>

                     
                <?php echo "<strong>Votre adresse mail actuelle : </strong>" , $donnees['email'] ,"</br>" ?>
		<label>Nouveau mail:</label>
                <input type="text" size="20" name="email" value="<?php echo $donnees['email']?>" maxlength="50" required autofocus></br></br></br>
                
                 <input type="submit" value="Enregistrer modifications" />
                
                
                
               <!--
                
                <?php echo "<strong>Votre pays actuel : </strong>" , $donnees['pays'] ,"</br>" ?>
		<label>Nouveau pays:</label>
                <input type="text" size="20" name="email" value="<?php echo $donnees['pays']?>" maxlength="50" required autofocus></br></br></br>
                
                
                <?php echo "<strong>Votre adresse actuelle : </strong>" , $donnees['adresse'] ,"</br>" ?>
		<label>Nouvelle adresse :</label>
                <input type="text" size="20" name="email" value="<?php echo $donnees['adresse']?>" maxlength="50" required autofocus></br></br></br>
                
               
                -->
                
              
                
        </form>
           
		
    </div> <!-- /container -->

        